1. Field of the Invention
The present invention relates to techniques for preventing a file system of a removable storage medium from being destroyed.
2. Description of the Related Art
Currently, removable storage media (such as secure digital (SD) memory cards) that provide excellent transportability and are less expensive than fixed disks, are used, for example, in personal computers, personal digital assistants (PDAs), mobile phones, and digital still cameras. Such SD memory cards serve as storage devices for storing files. Magneto-optical disks and the like are also widely used.
A removable storage medium, such as an SD memory card, has an advantage in that it is excellent in regard to transportability. However, since the user can remove a removable storage medium from a drive unit at any time, a file system may be destroyed and files stored in the storage medium may no longer be accessible if the storage medium is removed from the drive unit during the execution of file access to the medium.
In response, Japanese Patent Laid-Open No. 6-161863 discloses a method in which unique information is compared for the protection of data. Specifically, a drive unit writes unique information to a removable storage medium, temporarily suspends access processing to the medium during the removal of the medium, and retains the unique information in memory. When the storage medium is inserted again, the drive unit compares the unique information retained in its memory to that written in the storage medium. Then, only when they match, the drive unit permits access to the storage medium therein and restarts access processing to the medium.
However, this method has an inherent problem in that although data can be protected with respect to a first information-processing system from which a storage medium has been removed during the execution of input and output operations to and from the storage medium, data cannot be protected with respect to a second information-processing system differing from the first information-processing system. There are a couple of reasons why the aforementioned problem is caused, both of which are discussed below.
First, when a storage medium is inserted into an information-processing system, it cannot be determined, based only on the comparison of unique information, whether or not the storage medium has been removed from another information-processing system during the execution of input and output operations, and in this case, data stored in the storage medium may be modified.
And second, even if a forced removal flag indicating whether or not input and output operations are in progress is written to the storage medium together with unique information, data may be modified because an information-processing system without the above-described data protection function cannot recognize the forced removal flag. In this scenario, once data is modified, the data cannot be recovered or sometimes it may even be destroyed if the storage medium is inserted again into the first information-processing system from which the medium has been removed.